Godot - Source Code
Explanations
-
Why it is useful to modify Godot's Source Code .
-
The motivations given are:
-
Faster bug fixes.
-
The Source Code is the best source of documentation when you don't understand what something does in the engine.
-
~Certain things run faster in C++ (I am not interested in this).
-
-
It explains the philosophy if a new version of Godot is released and you want to keep your changes.
-
Build
Build from the terminal
-
Directory where I left the source downloaded:
-
cd "C:\Users\caior\Desktop\Programas\! Godot Launchers\godot-master\"
-
-
Compile the Source Code for Windows .
-
scons platform=windows. -
scons platform=windows production=yes debug_symbols=yes -
Dependencies:
-
Optimizations
Folders
-
core - Engine core summary (typedefs.h, config, crypto, error, extension, io, templates, object, os, string, and variant)
-
server - Internal game engine workings (rendering, display_server.h, navigation, audio, text)
-
scene - Nodes and resources used in the editor (main, main/viewport, 2d, 3d, animation, audio, debugger, gui, resources, and themes).
-
modules - Adds functionality to the engine
-
thirdparty - External libraries bundled in the engine (and he lists some examples).
-
drivers - A variety of technologies that allow Godot to be exported and run cross-platform.
-
editor - The engine's UI for editing game projects (export, project_manager, editor themes, etc).
-
platform - Specific platform support technologies.
-
main - Main entry point for the engine. The first lines the engine runs.
-
tests - Unit tests of the engine
-
bin - Not shown, generated when you build a project in Godot.
-
misc - Assorted scripts for making the engine compatible with various specific things.
Content
UID
-
Where can I check the uid match?
-
Look in the file
filesystem_cache8located in.godot/editor/. You can open it with a text editor. Each line corresponds to a resource. -
While the format of the lines is not documented (we could look in Godot source code for how it is generated and parsed), you should be able to find which file corresponds to the uid by searching for the uid.
-
-
ResourceUID:
-
-
print(ResourceLoader.get_resource_uid(resource))?
-
-
editor/editor_file_system.cpp
-
https://github.com/godotengine/godot/issues/78242
-
filesystem_cache8
-
Writing happens here:
(1325) void EditorFileSystem::_save_filesystem_cache(EditorFileSystemDirectory *p_dir, Ref<FileAccess> p_file) {.
-
-
-
scene/resources/resource_format_text.cpp
-
https://github.com/godotengine/godot/pull/73131
-
core/io/resource_format_binary.cpp
-
https://github.com/godotengine/godot/pull/78326
-
-
-
Debugging
Debugging with VSCode
-
Set up task.json and launch.json to Build and Debug Godot .
-
In addition to these settings, I added
platform=windowsin the build args.
-
-
Debugging the Engine using VS Code .
-
Video not very useful.
-
Debugging with VerySleepy
-
"To get useful profiling information, it is absolutely required to use a Godot build that includes debugging symbols. Official binaries do not include debugging symbols, since these would make the download size significantly larger. To get profiling data that best matches the production environment (but with debugging symbols), you should compile binaries with the
production=yes debug_symbols=yesSCons options."